package cn.edu.jju.psytest.model.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

@Entity
@Table(name = "tb_questions")
public class Question {

	private int questionId;
	private String content;
	private String options;
	private Quiz quiz;

	/**
	 * Getters And Setters
	 */

	@Id
	@GeneratedValue
	@Type(type = "int")
	@Column(name = "question_id")
	public int getQuestionId() {
		return questionId;
	}

	public void setQuestionId(int questionId) {
		this.questionId = questionId;
	}

	@Type(type = "string")
	@Column(length = 100)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Type(type = "string")
	@Column(length = 40)
	public String getOptions() {
		return options;
	}

	public void setOptions(String options) {
		this.options = options;
	}

	@ManyToOne
	@JoinColumn(name = "quiz_id")
	public Quiz getQuiz() {
		return quiz;
	}

	public void setQuiz(Quiz quiz) {
		this.quiz = quiz;
	}
}
